-
Notifications
You must be signed in to change notification settings - Fork 782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Add error messages for unsupported macro features on compilation #3993
[WIP] Add error messages for unsupported macro features on compilation #3993
Conversation
…o-features-on-compilation
CodSpeed Performance ReportMerging #3993 will not alter performanceComparing Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looking like the right direction for sure. You should also have a look at tests/test_compile_error.rs
and in particular tests/ui/abi3_nativetype_inheritance.rs
as an example of how we check error messages for the abi3
feature.
if is_abi3() && python_version >= PY_3_9 { | ||
set_option!(weakref); | ||
} else { | ||
return Err(syn::Error::new((weakref.span()), "`weakref` not supported until python 3.9 or graeter",)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if is_abi3() && python_version >= PY_3_9 { | |
set_option!(weakref); | |
} else { | |
return Err(syn::Error::new((weakref.span()), "`weakref` not supported until python 3.9 or graeter",)); | |
} | |
if python_version >= PY_3_9 || !is_abi3() { | |
set_option!(weakref); | |
} else { | |
return Err(syn::Error::new((weakref.span()), "`weakref` not supported with `abi3` until python 3.9 or graeter",)); | |
} |
Continued in #4194. Thanks for the contribution! |
This PR is in response to issue #3945
Returning an error message when calling an unsupported macro feature in compilation.
Currently only doing so for
weakref
.